#!/usr/bin/env python
# encoding: utf-8
# @author: Lin Han
# @contact: voldemort22@126.com
# @file: task.py
# @time: 2021/3/18 14:12
# @desc:
import time
from celery import Celery

# celery = Celery('tasks', broker='pyamqp://guest@localhost//')
celery = Celery('tasks', broker='redis://localhost:6379/0')


@celery.task
def send_mail(mail):
    print(f'sending mail to {mail["to"]}')
    time.sleep(2.0)
    print(f'mail sent.')
